package com.emergency.engine.domain;

import com.emergency.base.domain.BaseEntity;
import com.emergency.base.domain.Plan;
import com.emergency.base.domain.Scenar;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.util.List;

/**
 * Created by asus on 2020/3/23.
 */
@Entity
@Table(name = "bus_plan_score")
public class PlanScore extends BaseEntity{

    /**想定*/
    @OneToOne(targetEntity=Scenar.class,fetch= FetchType.EAGER)
    @JoinColumn(name="scenar_id",referencedColumnName="id")
    private Scenar scenar;

    /**方案计划*/
    @JsonIgnore
    @OneToOne(targetEntity=Plan.class,fetch= FetchType.LAZY)
    @JoinColumn(name="plan_id",referencedColumnName="id")
    private Plan plan;

    //方案分数
    private double pScore;

    public Scenar getScenar() { return scenar; }

    public void setScenar(Scenar scenar) { this.scenar = scenar;}

    public Plan getPlan() {        return plan;    }

    public void setPlan(Plan plan) { this.plan = plan;}

    public double getPScore() {  return pScore;}

    public void setPScore(double pScore) { this.pScore = pScore; }
}
